﻿<?php
	session_start();
	include "include.php";
?>
<html>
<head>
<title><?php echo $SITE_TITLE ?> - Loot Search</title>
<link rel="stylesheet" type="text/css" href="main.css" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Item Search</title>

<script type="text/javascript" src="jquery-1.2.1.pack.js"></script>
<script type="text/javascript">
	function item_lookup(items_name) {
		if(items_name.length == 0) {
			// Hide the suggestion box.
			$('#suggestions').hide();
		} else {
			$.post("rpc_item.php", {queryString: ""+items_name+""}, function(data){
				if(data.length >0) {
					$('#suggestions').show();
					$('#autoSuggestionsList').html(data);
				}
			});
		}
	} // lookup
	
	function item_fill(thisValue) {
		$('#items_name').val(thisValue);
		setTimeout("$('#suggestions').hide();", 200);
	}
</script>
</head>
<body>
<div id="container">
<div id="top">
<h1><?php echo $SITE_TITLE ?></h1>
</div>
<div id="leftnav">
<?php include "leftnav.php" ?>
</div>
<div id="content">
	<div>
		<form action="loot_search_process.php" method="post">
			<div>
				Item to search for:
				<input type="text" size="30" value="" name="items_name" id="items_name" onkeyup="item_lookup(this.value);" onblur="item_fill();" />
			</div>
			
			<div class="suggestionsBoxItem" id="suggestions" style="display: none;">
				<div class="suggestionList" id="autoSuggestionsList">
					&nbsp;
				</div>
			</div>
			<INPUT type="submit" value="Send"> <INPUT type="reset">
		</form>
	</div>
</div>
<div id="footer">
<?php include "footer.php" ?>
</div>
</div>
</body>
</html>